package com.example.usersvc.repository;

import com.example.usersvc.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, String> {

    /**
     * SELECT * FROM User WHERE name={name}
     * @param name
     * @return
     */
    Optional<User> findByName(String name);

    /**
     * SELCET * FROM User WHERE name={name} and id={id}
     * @param name
     * @param id
     * @return
     */
    Optional<User> findByNameAndId(String name, String id);



}
